package com.hnucm.c202001020214;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.gyf.immersionbar.ImmersionBar;
import com.hnucm.c202001020214.object.Ex_msg;

import org.greenrobot.eventbus.EventBus;

public class Exchange_Information extends BaseActivity {

    Button button;
//    List<Ex_msg> msg = new ArrayList<>();
    Ex_msg ex_msg;

    EditText editText5,editText6,editText7,editText8;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_exchange_information);

        ImmersionBar.with(this)
                // .statusBarColor(R.color.touMing)
                .init();

        editText5 = findViewById(R.id.editText5);
        editText6 = findViewById(R.id.editText6);
        editText7 = findViewById(R.id.editText7);
        editText8 = findViewById(R.id.editText8);


        button = findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String e5 = editText5.getText().toString();
                String e6 = editText6.getText().toString();
                String e7 = editText7.getText().toString();
                String e8 = editText8.getText().toString();

                if (e5.equals("") || e6.equals("") || e7.equals("") || e8.equals("")){
                    Toast.makeText(Exchange_Information.this,"不能为空",Toast.LENGTH_LONG).show();

                }else {

                    ex_msg = new Ex_msg(e5, e8, e7, e6);
                    EventBus.getDefault().post(ex_msg);

                    Toast.makeText(Exchange_Information.this,"修改成功",Toast.LENGTH_LONG).show();

                    finish();
                }
            }
        });
    }



}